<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>求红白黑球的个数</title>
    <script>
        var red = 0;
        var black = 0;
        var white = 0;
        for (red = 0; red <= 25; red++) {
            white = 25 - red;
            black = 31 - white;
            if (red + black == 28) {
                alert('红球：' + red + '\n白球：' + white + '\n黑球：' + black)
                break
            }
        }
    </script>
</head>

<body>

</body>

</html>